package code

import (
	"context"
	"io"
	"os"

	containertype "github.com/docker/docker/api/types/container"
)

// 打印指定容器的日志
func PrintLog() {
	cli := InitClient()

	ctx := context.Background()

	options := containertype.LogsOptions{ShowStdout: true}
	// Replace this ID with a container that really exists
	out, err := cli.ContainerLogs(ctx, "16aa", options)
	if err != nil {
		panic(err)
	}

	io.Copy(os.Stdout, out)
}
